package practice02;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author Administrator
 * @version V1.0
 * @ProjectName:IntelliJ IDEA
 * @PackageName: practice02
 * @ClassName: GetAddress
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @date 2019/12/30 18:33
 * @Copyright 大牛版板所有
 */
public class GetAddress {
    public static void main(String[] args) {
        try {
            InetAddress[] ias = InetAddress.getAllByName("www.baidu.com");
            for (InetAddress ia:ias) {
                System.out.println("IP地址："+ia.getHostAddress());
            }
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
    }
}
